library(RWeka)

setwd("D:/ClassificationR")

#proses 1
#membaca data training & data testing
data.training = read.csv("iris2class.train.1.csv")
data.test = read.csv("iris2class.test.1.csv")

#proses 2
#membuat model 
model = J48(Species~., data.training)

#proses 3
#melakukan prediksi
predict_result = predict(model, data.test[,-5])

#menampilkan hasil prediksi
comparation_result = cbind(prediction = as.character(predict_result), actual = as.character(data.test[,5]))
print(comparation_result)
